Marketing API
Discounts
List All Discounts
this endpoint ( get get ) retrieves all your discounts the response is paginated; therefore, you should use the 'page' parameter for navigating through the results in subsequent requests on successful completion, it returns an array of discount object docid\ y 9znrh28cmsoyhovk7fm the number of available results and the flags used for filtering permissions discounts view query parameters page fetch the results from a specific page it defaults to 1 per page the number of results to fetch per page the maximum is 50 and if it defaults to 10 from appendix docid\ kfbmx4q3dxjtduqf75yx1 start date used for filtering to appendix docid\ kfbmx4q3dxjtduqf75yx1 end date used for filtering sort by an optional identifier used for sorting results the available options are name , type and applies to filter optional text used for filtering results product id if provided, it will return the discounts that apply to the product customer id if provided, it will return the discounts that apply to the customer affiliate partner id type if provided, it will return the discounts with a matching type the possible values are customer discount and product discount applies to flag used for filtering discounts the possible values are all products , selected products and selected categories condition filters discounts by their main condition the possible values are all orders , item subtotal , item quantity , coupon , vouchers , order subtotal and order quantity status filters discounts by status the possible values are active and inactive require "uri" require "net/http" url = uri("https //api tamio com/v2/discounts/list?page=1\&per page=10") 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/list?page=1\&per page=10' \\ \ 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/list?page=1\&per page=10", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "discounts" \[ { "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" ] } ], "total results" 1, "page" 1, "per page" 10, "sort by" null, "filter" null }