Affiliates API
Affiliates
Add Bonus
this api endpoint (post) (post) adds a bonus to an affiliate if the request succeeds, it will return an affiliate object docid\ kcij54n ngxgdktcb7q8y ; otherwise, it will return an error permissions affiliates edit path parameters id the id of the affiliate body parameters amount integer the amount to offer as a bonus in cents require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/affiliates/bonus/add/c1797b4a 2694 4b90 a832 76856c1f3eef") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" data = { amount 10000 } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/affiliates/bonus/add/c1797b4a 2694 4b90 a832 76856c1f3eef' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "amount" 10000 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { amount 10000 }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/affiliates/bonus/add/c1797b4a 2694 4b90 a832 76856c1f3eef", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "affiliate" { "object" "affiliate", "email" "tests\@affiliate com", "name" "affiliate doe", "surname" null, "address" null, "city" null, "state" null, "country" "us", "postcode" null, "vat" null, "telephone" null, "id" "c1797b4a 2694 4b90 a832 76856c1f3eef", "affiliate program id" "040afdd0 3081 4712 b827 896b3b7cbfa7", "affiliate program label" "affiliate program 2023", "currency" "eur", "sales" 0, "referrals" 0, "language" "en", "balance" 10000, "bonus" 0, "approved" true, "payments" null } }