Skip to main content
PUT
/
connectors
/
consumers
/
{consumer_id}
/
vouchers
/
{voucher_id}
/
confirmation
Confirms a voucher previously reserved.
curl --request PUT \
  --url https://api.sandbox.paylead.tech/connectors/consumers/{consumer_id}/vouchers/{voucher_id}/confirmation \
  --header 'Authorization: Bearer <token>'
import requests

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

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}/vouchers/{voucher_id}/confirmation', 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}/confirmation",
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}/vouchers/{voucher_id}/confirmation"

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}/vouchers/{voucher_id}/confirmation")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

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

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
[
  {
    "offer_id": "94b36765-a06c-4baf-a33c-40e43686a96a",
    "price": 123,
    "value": 123,
    "brand": {
      "name": "<string>",
      "id": "e2c32b4b-de61-459b-accf-a75f76247946",
      "logo": "<unknown>",
      "reference": "MYBRAND-20180220-001"
    },
    "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.

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.