Core API
...
Core API Docs
Discounts
Get a Discount
code examples curl location globoff 'https //app sparklayer io/api/v1/discounts/{id}' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/discounts/{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/discounts/{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" response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/discounts/{id}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // successful response { "id" "942651af f950 4716 9916 16170fe0645f", "created at" "", "deleted at" "", "updated at" "", "name" "", "internal name" "", "internal slug" "", "calculation group" 0, "priority" 0, "times applicable per order" 0, "max rewards" 0, "groups" \[ "default" ], "simultaneity" \[ "default" ], "requirement selection type" "", "reward selection type" "", "currency code" "gbp", "start date" "", "end date" "", "active" false, "requirements" \[ { "items" \[ { "restrictions" \[ { "type" "", "ref" "" } ], "points type" "", "points" 0, "quantity" 0, "selection type" "" } ], "max rewards" 0, "min spend" 0, "max spend" 0, "spend tax type" "", "selection type" "", "min points" 0 } ], "rewards" \[ { "type" "", "amount type" "", "item id" "", "amount" 0 } ], "other requirements" \[ {} ] }// error response