Redemptions & Rewards
Each panelist in Pureprofile has the option to redeem available rewards. This section includes endpoints for:
- Retrieving redemption history
- Retrieving rewards
- Redeeming rewards
Get redemption history
An example for getting retrieving a panelist's redemption history is shown below:
- cURL
- Node
- Python
- Go
curl --location --request GET 'https://api.sandbox.pureprofile.io/v1/panel/redemptions' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'
var axios = require("axios");var config = { method: "get", url: "https://api.sandbox.pureprofile.io/v1/panel/redemptions", headers: { Accept: "application/json", Authorization: "Bearer <access_token>", },};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/redemptions"payload={}headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/redemptions" method := "GET" client := &http.Client {} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
The response contains a list of the redemptions for the panelist:
{ "message": "success", "redemptions": [ { "cost": 10, "currency": "GBP", "reward_point_cost": 1164, "id": 190, "reward": { "id": 34, "name": "Halfords eGift Card", "cost": 10, "cost_currency": "GBP", "type": "TangoCard", "image_url": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-300w-326ppi.png", "meta_data": { "utid": "U898420", "terms": "<ul>\r\n\t<li>The minimum load value is £1, and the maximum load value is £1,000.</li>\r\n\t<li>You can check your e-gift card balance online at Halfords.com or www.giftcards.halfords.com alternatively, you can check your e-gift card balance in store at any Halfords store.</li>\r\n\t<li>You cannot top-up an e-gift card, but you can purchase another one.</li>\r\n\t<li>You can use an e-gift card as part or full payment and in conjunction with another payment method such as a debit or credit card or another e-gift card or cash, in any Halfords store.</li>\r\n\t<li>The remaining funds on the e-gift card will remain available for redemption until the e-gift card expires.</li>\r\n\t<li>The e-gift card is valid for 24 months after date of purchase.</li>\r\n\t<li>Lost or stolen e-gift cards cannot be replaced.</li>\r\n\t<li>E-gift cards are redeemable in any Halfords retail store but are not redeemable online or at Halfords Autocentres</li>\r\n\t<li>All refunds are made in the payment method, or combinations of payment methods used for the transaction.</li>\r\n</ul>\r\n", "brand_key": "B426171", "countries": ["UK", "GB"], "max_value": "250.00", "min_value": "1.00", "brand_name": "Halfords", "disclaimer": "<p>Halfords is not a sponsor of the rewards or otherwise affiliated with this reward program. The logos and other identifying marks attached are trademarks of and owned by each represented company and/or its affiliates. Please visit each company's website for additional terms and conditions.</p>\r\n", "image_urls": { "80w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-80w-326ppi.png", "130w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-130w-326ppi.png", "200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-200w-326ppi.png", "278w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-278w-326ppi.png", "300w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-300w-326ppi.png", "1200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b426171-1200w-326ppi.png" }, "value_type": "VARIABLE_VALUE", "description": "<p>Halfords Gift Cards are a flexible present, which allow the recipient to choose whatever they want from our wide range of products in-store Whether there's a birthday coming up or Christmas is around the corner, Halfords gift cards are perfect for any occasion!</p>\r\n", "reward_name": "Halfords eGift Card", "reward_type": "gift card", "currency_code": "GBP", "short_description": "<p>Halfords Gift Cards are a flexible present, which allow the recipient to choose whatever they want from our wide range of products in-store Whether there's a birthday coming up or Christmas is around the corner, Halfords gift cards are perfect for any occasion!</p>\r\n", "redemption_instructions": "<ol>\r\n\t<li>Click the Redemption URL above to access your egift card.</li>\r\n\t<li>Present to the cashier upon payment and the egift will be used as a tender type. You can use an e-gift card as part or full payment and in conjunction with another payment method such as a debit or credit card or another e-gift card or cash, in any Halfords store.</li>\r\n</ol>\r\n\r\n<p>The remaining funds on the e-gift card will remain available for redemption until the e-gift card expires.</p>\r\n" }, "reward_point_cost": null }, "approved": true, "processed": true, "created_at": "2022-07-01T11:30:40", "updated_at": "2022-07-01T11:31:00", "failed": false, "refunded": false, "partner_status": "COMPLETE", "failed_reason": null, "transaction_id": null }, { "cost": 5, "currency": "GBP", "reward_point_cost": 582, "id": 189, "reward": { "id": 74, "name": "PayPal 5 GBP", "cost": 5, "cost_currency": "GBP", "type": "PayPal", "image_url": "https://sampleninja-production-storage-public-us-west-2.s3.amazonaws.com/public/img/paypal-logo.png", "meta_data": { "image_url": "https://sampleninja-production-storage-public-us-west-2.s3.amazonaws.com/public/img/paypal-logo.png" }, "reward_point_cost": null }, "approved": true, "processed": true, "created_at": "2022-07-01T11:29:28", "updated_at": "2022-07-01T11:29:37", "failed": false, "refunded": false, "partner_status": "UNCLAIMED", "failed_reason": null, "transaction_id": null } ]}
Get available rewards
Pureprofile offers multiple rewards for it's panelists. Different rewards are enabled for each panel based in the initial panel setup. In order to get the rewards available for a panelist you must use the endpoint below:
- cURL
- Node
- Python
- Go
curl --location --request GET 'https://api.sandbox.pureprofile.io/v1/panel/rewards' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'
var axios = require("axios");var config = { method: "get", url: "https://api.sandbox.pureprofile.io/v1/panel/rewards", headers: { Accept: "application/json", Authorization: "Bearer <access_token>", },};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/rewards"payload={}headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/rewards" method := "GET" client := &http.Client {} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
The response contains a list of the redemptions for the panelist:
{ "message": "success", "rewards": [ { "id": 22, "name": "Argos eGift Card £50", "cost": 50, "cost_currency": "GBP", "type": "TangoCard", "image_url": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-300w-326ppi.png", "meta_data": { "utid": "U635691", "terms": "<p>eGift Cards may be redeemed in full or part payment for goods in any UK Argos store or online at <a href=\"http://www.argos.co.uk\">http://www.argos.co.uk</a>, including current promotional offers, at the prevailing prices listed. eGift Cards cannot be used for purchases made over the phone. eGift Cards cannot be used for the purchase of other gift cards or vouchers. GBP £ eGift Cards cannot be redeemed in ROI. This eGift Card is not a credit, debit or cheque guarantee card, cannot be redeemed for cash or returned under the Argos 30 Day Guarantee and cannot be re-sold or re-tendered. This will not affect your statutory rights. Please see expiry date on the eGift Card. Argos Ltd reserve the right to decline or withdraw the eGift Card at any time. Treat this eGift Card like cash, Argos Ltd cannot be held liable for lost, stolen or damaged eGift Cards and they will not be replaced. To check your balance at any time please sign into your account at <a href=\"http://www.argos.co.uk\">http://www.argos.co.uk</a> and use the balance checker provided.</p>\r\n", "brand_key": "B719673", "countries": ["UK", "GB"], "max_value": "50.00", "min_value": "50.00", "brand_name": "Argos", "disclaimer": "<p>Argos is not a sponsor of the rewards or otherwise affliated with this company. The logos and other identifying marks attached are trademarks of and owned by each represented company and/or its affliates. Please visit each company's website for additional terms and conditions.</p>\r\n", "image_urls": { "80w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-80w-326ppi.png", "130w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-130w-326ppi.png", "200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-200w-326ppi.png", "278w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-278w-326ppi.png", "300w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-300w-326ppi.png", "1200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b719673-1200w-326ppi.png" }, "value_type": "FIXED_VALUE", "description": "<p>50,000 products, 1 eGift Card The new Argos eGift Card is the perfect way to get your hands on shiny new stuff. Fast. Delivered to you by email, you can spend your eGift Card online at argos.co.uk. Letting you shop from your sofa. Or the pub. Or anywhere you like really. We don't mind. Or you can use it in any of our 840 stores. Perfect if you fancy a bit of fresh air and a stroll. Either way, just enjoy spending it. With over 50,000 products to choose from at Argos, you've got some decisions to make. We have all the latest must have items. From tech to toys, furniture to jewellery, there‘s bound to be a great gift for you. Want it today? With Argos Fast Track Delivery available on many items, Argos can deliver to your door the same day! Just check for the Fast Track badge on your selected product at <a href=\"http://www.argos.co.uk\">argos.co.uk</a>. Select Argos eGift Card. Go Argos.</p>\r\n\r\n<p>Argos codes will be valid for 12 Months.</p>\r\n", "reward_name": "Argos eGift Card £50", "reward_type": "gift card", "currency_code": "GBP", "short_description": "<p>With over 50,000 products to choose from at Argos, you've got some decisions to make. We have all the latest must have items. From tech to toys, furniture to jewellery, there‘s bound to be a great gift for you. Want it today? With Argos Fast Track Delivery available on many items, Argos can deliver to your door the same day! Just check for the Fast Track badge on your selected product at <a href=\"http://www.argos.co.uk\">argos.co.uk</a>. Select Argos eGift Card. Go Argos.</p>\r\n\r\n<p>Argos codes will be valid for 12 Months.</p>\r\n", "redemption_instructions": "<ol>\r\n\t<li>Click on the above link to access your eGift Card.</li>\r\n\t<li>Spend online at <a href=\"http://www.argos.co.uk/\">argos.co.uk</a>, via the Argos app, or in any UK Argos store.</li>\r\n</ol>\r\n" }, "reward_point_cost": 5908 }, { "id": 25, "name": "Caffè Nero Gift Card", "cost": 50, "cost_currency": "GBP", "type": "TangoCard", "image_url": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-300w-326ppi.png", "meta_data": { "utid": "U553414", "terms": "<ol>\r\n\t<li>This Card can be used in participating stores as full or part payment of products subject to the in-store technology.</li>\r\n\t<li>This Card cannot be redeemed for cash and no change will be given if the value of purchases is less than the value of this Card.</li>\r\n\t<li>This Card should be treated as cash.</li>\r\n\t<li>This Card is valid for 18 months from the date that value is loaded. Please visit <a href=\"http://www.caffenero.com\">www.caffenero.com</a> to check your card balance and to see full terms and conditions including cancellation policy.</li>\r\n</ol>\r\n", "brand_key": "B371663", "countries": ["UK", "GB"], "max_value": "100.00", "min_value": "5.00", "brand_name": "Caffè Nero", "disclaimer": "<p>Caffè Nero is not a sponsor of the rewards or otherwise affliated with this company. The logos and other identifying marks attached are trademarks of and owned by each represented company and/or its affliates. Please visit each company's website for additional terms and conditions.</p>\r\n", "image_urls": { "80w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-80w-326ppi.png", "130w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-130w-326ppi.png", "200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-200w-326ppi.png", "278w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-278w-326ppi.png", "300w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-300w-326ppi.png", "1200w-326ppi": "https://dwwvg90koz96l.cloudfront.net/images/brands/b371663-1200w-326ppi.png" }, "value_type": "VARIABLE_VALUE", "description": "<p>Use your Caffè Nero eGift Card across the UK to buy their award winning traditional Italian coffees, handmade drinks or selection of sandwiches and cakes.</p>\r\n", "reward_name": "Caffè Nero Gift Card", "reward_type": "gift card", "currency_code": "GBP", "short_description": "<p>Use your Caffè Nero eGift Card across the UK to buy their award winning traditional Italian coffees, handmade drinks or selection of sandwiches and cakes.</p>\r\n", "redemption_instructions": "<p>Click the link above to access your eGift Card. To use your eGift Card in store, simply print out the page containing your card information, or present as payment on your mobile device. </p>\r\n" }, "reward_point_cost": 5908 } ]}
Redeem a reward
Below is a sample for redeeming a reward. In order for this to be successful the panelist must have the required amount (Points) in his balance. The payload when calling the endpoint is the reward id from the previous endpoint:
- cURL
- Node
- Python
- Go
curl --location --request GET 'https://api.sandbox.pureprofile.io/v1/panel/redemption' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'--data-raw '{ "id": <reward id>}'
var axios = require('axios');var data = JSON.stringify({ "id": <reward id>});var config = { method: 'post', url: 'https://api.sandbox.pureprofile.io/v1/panel/redemption', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>' }, data: data};axios(config).then(function (response) { console.log(JSON.stringify(response.data));}).catch(function (error) { console.log(error);});
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/redemption"payload = json.dumps({ "id": <reward id>})headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/redemption" method := "POST" payload := strings.NewReader(`{ "id": <reward id>> }`) client := &http.Client {} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
If the redemption is successfull the message below will be returned:
{ "message": "success"}