Get Customer Specific Pricing
code examples curl request post \\ \ url https //app sparklayer io/api/v1/fetch customer pricing \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'site id jones climbing' \\ \ data '{ "customer id" "123e4567 e89b 12d3 a456 426614174000", "customer lookup by" "", "line items" \[ { "sku" "widget red m", "quantity" 10 } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("site id", "jones climbing"); var raw = json stringify({ "customer id" "123e4567 e89b 12d3 a456 426614174000", "customer lookup by" "", "line items" \[ { "sku" "widget red m", "quantity" 10 } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/fetch customer pricing", 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/fetch customer pricing") 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" request body = json dump({ "customer id" "123e4567 e89b 12d3 a456 426614174000", "customer lookup by" "", "line items" \[ { "sku" "widget red m", "quantity" 10 } ] }) response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/fetch customer pricing" payload = json dumps({ "customer id" "123e4567 e89b 12d3 a456 426614174000", "customer lookup by" "", "line items" \[ { "sku" "widget red m", "quantity" 10 } ] }) 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 — all line items resolved pricing { "line items" \[ { "sku" "", "quantity" 0, "error" "", "currency code" "usd", "unit price" { "net" "" }, "line total" { "net" "" }, "quantity price breaks" \[ { "min quantity" 0, "price" { "net" "" }, "unit of measure" "box" } ] } ] }// partial success — one or more line items could not be priced { "line items" \[ { "sku" "", "quantity" 0, "error" "", "currency code" "usd", "unit price" { "net" "" }, "line total" { "net" "" }, "quantity price breaks" \[ { "min quantity" 0, "price" { "net" "" }, "unit of measure" "box" } ] } ] }// validation error