Create Cart
code examples curl request post \\ \ url https //app sparklayer io/api/v1/carts \\ \ header 'accept application/json' \\ \ header 'site id jones climbing'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("site id", "jones climbing"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/carts", 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/carts") 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\["site id"] = "jones climbing" response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/carts" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'site id' 'jones climbing' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful response { "cart id" "9151f21f 43ae 43b4 92f3 f4af67cdf544" }// error response