Get Cart
code examples curl request get \\ \ url https //app sparklayer io/api/v1/carts/{id} \\ \ 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 'get', headers myheaders, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/carts/{id}", 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/{id}") https = net http new(url host, url port) https use ssl = true request = net http get 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/{id}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'site id' 'jones climbing' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // successful response { "id" "", "intent" "", "customer id" "", "shipping address id" "", "billing address id" "", "items" \[ { "sku" "", "quantity" 0, "line total" { "net" "", "gross" "", "tax rate" "", "currency code" "" }, "unit total" {} } ], "totals" { "total" { "pre discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "charge" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" } }, "shipping" { "pre discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "charge" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" } }, "sub total" { "pre discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "discount" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" }, "charge" { "net" { "amount" "", "currency code" "" }, "gross" { "amount" "", "currency code" "" }, "tax" { "amount" "", "currency code" "" }, "apportioned tax rate" "", "currency" "" } } }, "customer addresses" \[ { "id" "", "uuid" "", "first name" "", "last name" "", "company" "", "description" "", "address line 1" "", "address line 2" "", "city" "", "postal code" "", "country code" "", "region code" "", "phone" "", "external id" "" } ], "validation errors" \[ "" ] }// cart not found // unprocessable entity {}// error response