Skip to main content
GET
/
connectors
/
consumers
/
{consumer_id}
/
vouchers
/
{voucher_id}
Retrieves the details of a voucher for a given consumer.
curl --request GET \
  --url https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id}"

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

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

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

fetch('https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id}', 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}/vouchers/{voucher_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/vouchers/{voucher_id}"

req, _ := http.NewRequest("GET", 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.get("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id}")

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

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

response = http.request(request)
puts response.read_body
{
  "offer_id": "94b36765-a06c-4baf-a33c-40e43686a96a",
  "price": 123,
  "value": 123,
  "brand": {
    "name": "<string>",
    "id": "e2c32b4b-de61-459b-accf-a75f76247946",
    "logo": {
      "path": "<string>",
      "content_type": "<string>",
      "created_at": "2019-01-31T15:16:15.523309+00:00",
      "id": "e2c32b4b-de61-459b-accf-a75f76247946",
      "links": {
        "download": "<string>",
        "preview": "<string>"
      },
      "name": "<unknown>",
      "owner": "<string>"
    }
  },
  "codes": [
    {
      "value": 123,
      "activation_code": "<string>",
      "code": "<string>",
      "validity_date": "2023-12-25"
    }
  ],
  "id": "e2c32b4b-de61-459b-accf-a75f76247946",
  "reservation_date": "2023-12-25",
  "reservation_expired_date": "2023-12-25",
  "validity_date": "2023-12-25"
}

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

voucher_id
string<uuid>
required

Unique ID of the voucher on PayLead.

Response

OK

offer_id
string<uuid>
required
read-only

Unique UUID of the offer

Example:

"94b36765-a06c-4baf-a33c-40e43686a96a"

price
number
required
read-only

Price paid by the consumer.

status
enum<string>
required
read-only

Current status of the voucher.

Available options:
RESERVED,
CANCELLED,
CONFIRMED,
READY,
REFUNDING,
REFUNDED,
REFUND_REJECTED
Maximum string length: 15
value
number
required
read-only

Nominal value of the voucher.

brand
object
codes
object[]
read-only

List of codes to be used in merchant shop.

id
string<uuid>
read-only

Unique ID of the object.

Example:

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

reservation_date
string<date>
read-only

Date when the voucher has been reserved.

reservation_expired_date
string<date>
read-only

Date when the reservation expired. If this date is passed, the voucher is automatically cancelled.

validity_date
string<date>
read-only

voucher validity date, after this date the voucher is not valid anymore and can't be used.