Skip to main content
PUT
/
connectors
/
consumers
/
{consumer_id}
/
offers
/
{offer_id}
/
favorite
Favorites an Offer
curl --request PUT \
  --url https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite"

headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, headers=headers)

print(response.text)
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/offers/{offer_id}/favorite")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "name": "<string>",
  "reference": "MYBRAND-20180220-001",
  "type": "CASHBACK",
  "application_channel": "ONLINE",
  "application_url": "https://www.mybrand.fr",
  "brand": {
    "description": "<string>",
    "id": "e2c32b4b-de61-459b-accf-a75f76247946",
    "legal_terms": "<string>",
    "logo": {
      "content_type": "<string>",
      "id": "e2c32b4b-de61-459b-accf-a75f76247946",
      "links": {
        "download": "<string>",
        "preview": "<string>"
      },
      "name": "<string>",
      "owner": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    },
    "name": "<string>",
    "universes": [
      {
        "children": "<array>",
        "id": "e2c32b4b-de61-459b-accf-a75f76247946",
        "name": "<string>",
        "parent_id": "5c5e6d04-9dfc-46b8-9432-7c977f1dca23"
      }
    ]
  },
  "description": "<string>",
  "end_date": "2018-12-21T00:00:00+00:00",
  "highlight_level": "HIGH",
  "id": "e2c32b4b-de61-459b-accf-a75f76247946",
  "is_favorite": true,
  "legal_terms": "<string>",
  "max_discount_rate": 123,
  "max_value": 123,
  "min_value": 123,
  "picture": {
    "content_type": "<string>",
    "id": "e2c32b4b-de61-459b-accf-a75f76247946",
    "links": {
      "download": "<string>",
      "preview": "<string>"
    },
    "name": "<string>",
    "owner": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "proposed_vouchers": [
    {
      "price": 123,
      "value": 123
    }
  ],
  "start_date": "2018-12-21T00:00:00+00:00",
  "voucher_modes": "<unknown>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

consumer_id
string
required

The id you used to create the given consumer

offer_id
string<uuid>
required

Unique ID of the offer on PayLead system.

Response

OK

name
string
required
read-only

Name of the object

reference
string
required
read-only

Unique reference of the offer. Human readable, made out from the concatenation of the brand name + creation date + increment.

Example:

"MYBRAND-20180220-001"

type
enum<string>
required
read-only

Enum in: CASHBACK, UNIQUE_COUPON, GENERIC_COUPON

Available options:
VOUCHER
Example:

"CASHBACK"

application_channel
enum<string> | null
read-only

Offer availability: ONLINE if the offer is online only. OFFLINE if the offer is offline only. BOTH if the offer is online and offline

Available options:
BOTH,
ONLINE,
OFFLINE
Maximum string length: 7
Example:

"ONLINE"

application_url
string<url> | null
read-only

URL to reach the offer if the offer channel is ONLINE or BOTH

Example:

"https://www.mybrand.fr"

brand
object
description
string | null
read-only

description

end_date
string<date-time> | null
read-only

Date (ex. 2017-12-26T23:00:00+00:00): End date of the offer.

Example:

"2018-12-21T00:00:00+00:00"

highlight_level
enum<string> | null
read-only

Enum in: HIGHEST, HIGH, NORMAL. For a contextual display (banner, carousel etc...), this value is set by the program manager on each offer

Available options:
HIGHEST,
HIGH,
NORMAL
Maximum string length: 7
Example:

"HIGH"

id
string<uuid>
read-only

Unique ID of the object.

Example:

"e2c32b4b-de61-459b-accf-a75f76247946"

is_favorite
boolean
read-only

TRUE if the offer is liked by consumer, FALSE if not

Example:

true

Legal terms

max_discount_rate
number | null
read-only

Represents the best absolute ratio between the price and value of the different vouchers

max_value
number | null
read-only

Maximum value of the vouchers

min_value
number | null
read-only

Minimum value of the vouchers

picture
object
proposed_vouchers
object[]
read-only

A list of suggested vouchers, including both their price and their value. Only provided on GET queries when "?include=proposed_vouchers" is included in the request.

start_date
string<date-time>
read-only

Date (ex. 2017-12-26T23:00:00+00:00): Start date of the offer.

Example:

"2018-12-21T00:00:00+00:00"

voucher_modes
any
read-only

BONUS: The voucher value is higher or equal than the provided voucher price. DISCOUNT: The voucher price is lower or equal than the provided voucher value