Marketing API
Discounts
Retrieve Discount
this api endpoint ( get get ) retrieves a discount object by id if the request succeeds, it will return a discount object docid\ y 9znrh28cmsoyhovk7fm permissions discounts view path parameters id the id of the discount to retrieve require "uri" require "net/http" url = uri("https //api tamio com/v2/discounts/retrieve/13316518 3fc8 4418 b14f e8efea620d43") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" response = https request(request) puts response read body curl location request get 'https //api tamio com/v2/discounts/retrieve/13316518 3fc8 4418 b14f e8efea620d43' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //api tamio com/v2/discounts/retrieve/13316518 3fc8 4418 b14f e8efea620d43", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "discount" { "id" "13316518 3fc8 4418 b14f e8efea620d43", "label" "black friday 50% off", "currency" "eur", "percent off" 50, "object" "discount", "amount off" 0, "shipping percent off" 0, "shipping amount off" 0, "active" false, "type" "product discount", "payments" \[ "all" ], "created at" 1669130701, "expiry date" null, "block affiliates" false, "destinations" \[ "worldwide" ], "condition" "coupon", "applies to" "selected products", "rule amount" null, "subscription discount duration" "forever", "number of months" null, "domain" null, "coupon" "blackfriday2022", "coupon max redemptions" 100, "coupon times redeemed" 0, "products" \[ "5a3da42d d007 49e0 937d 8388d45ba05e" ] } }