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
{
  "cashback_rate": 5,
  "highlight_level": "HIGH",
  "id": "e2c32b4b-de61-459b-accf-a75f76247946",
  "name": "<string>",
  "status": "<string>",
  "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"
      }
    ]
  },
  "consumed": true,
  "created_at": "2019-01-31T15:16:15.523309+00:00",
  "description": "<string>",
  "end_date": "2017-12-26T23:00:00+00:00",
  "favorite": true,
  "is_activated": true,
  "legal_terms": "<string>",
  "max_amount": 250,
  "max_cashbacks_per_consumer": 123,
  "merchant": {
    "name": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "logo": {
      "content_type": "<string>",
      "id": "e2c32b4b-de61-459b-accf-a75f76247946",
      "links": {
        "download": "<string>",
        "preview": "<string>"
      },
      "name": "<string>",
      "owner": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  },
  "min_amount": 40,
  "network": "739c5ba7-8831-4664-9ce3-73e9f1e50c09",
  "picture": {
    "content_type": "<string>",
    "id": "e2c32b4b-de61-459b-accf-a75f76247946",
    "links": {
      "download": "<string>",
      "preview": "<string>"
    },
    "name": "<string>",
    "owner": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "program": {
    "id": "<string>",
    "legal_terms": "<string>",
    "name": "<string>"
  },
  "publication_date": "2019-01-01T00:00:00+00:00",
  "reference": "MYBRAND-20180220-001",
  "segments": [
    {
      "id": "e2c32b4b-de61-459b-accf-a75f76247946"
    }
  ],
  "source_transaction": true,
  "start_date": "2018-12-21T00:00:00+00:00",
  "universes": [
    {
      "id": "e2c32b4b-de61-459b-accf-a75f76247946",
      "name": "<string>"
    }
  ]
}

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

cashback_rate
number
required
read-only

Rate of reward used to calculate cashback amount

Required range: 0 <= x <= 100
Example:

5

highlight_level
string
required
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

Example:

"HIGH"

id
string<uuid>
required
read-only

Unique ID of the object.

Example:

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

name
string
required
read-only

Name of the object

status
string
required
read-only
  • ACTIVE: The offer is available and your customers can benefit from it.
  • COMPLETED: The campaign budget has been completely spent, the offer is no longer active.
  • PUBLISHED: The offer is published but not yet active. You can choose to display them to tease your customers.
type
enum<string>
required
read-only

Enum in: CASHBACK, UNIQUE_COUPON, GENERIC_COUPON

Available options:
CASHBACK,
UNIQUE_COUPON,
GENERIC_COUPON
Example:

"CASHBACK"

application_channel
enum<string>
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:
ONLINE,
OFFLINE,
BOTH
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
consumed
boolean
read-only

Has the consumer already consumed the coupon of the current offer? If true, yes. If false, no.

Example:

true

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

Object creation datetime

Example:

"2019-01-31T15:16:15.523309+00:00"

description
string | null
read-only

description

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

End date of the offer. A transaction has to be executed before (inclusive) this date to be able to generate cashback for the consumer.

Example:

"2017-12-26T23:00:00+00:00"

favorite
boolean
read-only

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

Example:

true

is_activated
boolean
read-only

TRUE if the object is active, FALSE if not

Example:

true

Legal terms

max_amount
number<float> | null
read-only

Maximum transaction amount for this offer. the maximum reward for this offer is max_amount x cashback_rate

Example:

250

max_cashbacks_per_consumer
integer | null
read-only

The maximum number of rewards that can be obtained by a consumer, if "None", it's unlimited, on a given offer

merchant
object | null
read-only

Merchant that has created the offer

min_amount
number<float> | null
read-only

Minimum amount for a transaction to be able to generate a reward for the consumer

Example:

40

network
object | null
read-only

UUID: If the offer is promoting a selection of stores belonging to a specific network, ID of the network. Else, null

Example:

"739c5ba7-8831-4664-9ce3-73e9f1e50c09"

picture
object
program
object
read-only

Program manager object.

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

Offer publication datetime. An offer can be published before its starting date (for teasing purposes)

Example:

"2019-01-01T00:00:00+00:00"

reference
string
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"

segments
object[]
read-only

Segments of offers

source_transaction
boolean
read-only

If this flag is true, the transaction must come from the default bank of the program to generate a reward

start_date
string<date-time>
read-only

Date (ex. 2017-12-26T23:00:00+00:00): Start date of the offer. A transaction has to be executed after (inclusive) this date to be able to generate cashback for the consumer.

Example:

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

universes
object[]
read-only

Universes